package ads;

import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main {
	public static void main(String args[]){
		Map<String,Integer> words = new TreeMap<>();
		Scanner sc = new Scanner(System.in);
		int k = 1;
		while(true){
		String word = sc.next();
		if(word.equals("!!!!!"))
			break;
		if(words.containsKey(word))
			words.put(word, k++);
		else
			words.put(word, k);
		}
		System.out.println(words.size());
		int i = 0;
		for(Map.Entry<String, Integer> entry : words.entrySet()){
			
	         String key = entry.getKey();  
	         int value = entry.getValue();  
			if(i++<10)
				System.out.println(entry.getKey()+":"+entry.getValue());
		}
	}
}
